
package com.insigma.business.qrcode.intell.service.impl;


import com.insigma.business.qrcode.common.service.SequenceGenerator;
import com.insigma.business.qrcode.intell.dao.CommonKeywordDao;
import com.insigma.business.qrcode.intell.dto.CommonKeywordBSearcher;
import com.insigma.business.qrcode.intell.entity.CommonKeywordDO;
import com.insigma.business.qrcode.intell.service.CommonKeywordService;
import com.insigma.business.qrcode.soldier.dto.SequenceNameConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("commonKeywordService")
public class CommonKeywordServiceImpl implements CommonKeywordService {

    @Autowired(required = false)
    private CommonKeywordDao commonKeywordDao;
    @Autowired(required = false)
    private SequenceGenerator sequenceGenerator;

    
    @Override
    public List<CommonKeywordDO> search(final CommonKeywordBSearcher commonKeywordBSearcher) {
        return commonKeywordDao.search(commonKeywordBSearcher);
    }
   
    @Override
    public CommonKeywordDO get(final String id){
        return commonKeywordDao.get(id);
    }

    
    @Override
    public Integer insert(final CommonKeywordDO commonKeywordDO){
        commonKeywordDO.setId(sequenceGenerator.genKey(SequenceNameConstant.COMMON_KEYWORD_ID));
        return commonKeywordDao.insert(commonKeywordDO);
    }

    
    @Override
    public Integer update(final CommonKeywordDO commonKeywordDO){
        return commonKeywordDao.update(commonKeywordDO);
    }

    
    @Override
    public Integer delete(final String id, final String modifierType, final String modifierId){
        return commonKeywordDao.delete(id,modifierType,modifierId);
    }

}
